Skip to content

fix: shorter codegen name#1251

Merged
kirillzyusko merged 2 commits intomainfrom
fix/shorter-codegen-name
Dec 17, 2025
Merged

fix: shorter codegen name#1251
kirillzyusko merged 2 commits intomainfrom
fix/shorter-codegen-name

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Dec 17, 2025

📜 Description

Use keyboardcontroller instead of reactnativekeyboardcontroller as c++ library name.

💡 Motivation and Context

Using reactnativekeyboardcontroller produces very long pathnames, for example: reactnativekeyboardcontroller_autolinked_build/CMakeFiles/react_codegen_reactnativekeyboardcontroller.dir/C_/Users/irust/connect/node_modules/react-native-keyboard-controller/common/cpp/react/renderer/components/reactnativekeyboardcontroller/RNKCKeyboardBackgroundViewShadowNode.cpp.o -> 282 symbols (which exceeds the limit of 260 characters on Windows).

With keyboardcontroller it will be keyboardcontroller_autolinked_build/CMakeFiles/react_codegen_keyboardcontroller.dir/C_/Users/irust/connect/node_modules/react-native-keyboard-controller/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewShadowNode.cpp.o (which is only 251 symbol).

This PR will not fix all problems with linking on windows, but at least if project is close to the beginning of the root of the disk (i. e. C_/Users/irust/connect) the project will be assembled without errors 🤷‍♂️

Important

I had to remove FabricExample/android/build/generated/autolinking/autolinking.json so that the file can be re-assembled again to avoid compilation errors.

Closes #1147 #1247

📢 Changelog

JS

  • change reactnativekeyboardcontroller -> keyboardcontroller

iOS

  • change reactnativekeyboardcontroller -> keyboardcontroller

Android

  • change reactnativekeyboardcontroller -> keyboardcontroller

C++

  • change reactnativekeyboardcontroller -> keyboardcontroller

🤔 How Has This Been Tested?

Tested manually via this PR + locally run fabric build on iOS/Android.

📸 Screenshots (if appropriate):

image

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Dec 17, 2025
@kirillzyusko kirillzyusko added the refactor You changed the code but it didn't affect functionality label Dec 17, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 17, 2025

📊 Package size report

Current size Target Size Difference
230360 bytes 230359 bytes 1 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review December 17, 2025 10:21
@kirillzyusko kirillzyusko merged commit afeccd1 into main Dec 17, 2025
31 of 32 checks passed
@kirillzyusko kirillzyusko deleted the fix/shorter-codegen-name branch December 17, 2025 16:35
@kirillzyusko kirillzyusko mentioned this pull request Jan 12, 2026
2 tasks
kirillzyusko added a commit that referenced this pull request Jan 12, 2026
## 📜 Description

Added a job for building example app on windows and shortened `codegen`
name to fix build errors.

## 💡 Motivation and Context

This is a continuation of
#1251

In
#1251
we shortened codegen name from `reactnativekeyboardcontroller` till
`keyboardcontroller`. In this PR we make it even shorter: from
`keyboardcontroller` -> `RNKC`. The `keyboardcontroller` has 18 symbols,
`safeareacontext` (very popular lib) has 15 symbols, so our lib will
exceed symbols limitation, when `safeareacontext` will not. Now I make
length only 4 symbols. While I'm not a big fan of making
variables/pathname shorter, because it makes more effort for newcomers
to understand the code, but here I'm ready to sacrifice readability in
favor of smaller amount of issues with complaints that builds are
failing on windows.

I hope in 2026 RN team will update Ninja/CMake to newest version and
this limitation will gone, but for now let's use shorter name and fix
windows build errors.

Also I'd like to say few words about CI job. I've tried to assemble
example app on windows runners, but I had compilation errors because of
reanimated. So I went in a different direction. I create a new app and
then link my lib locally to this project (just to check compilation
issues). Not very elegant but it does its job - it gives me more
confidence, that windows builds are not occasionally get broken 🤞

Closes
#1247
#1147
#1253

## 📢 Changelog

<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->

### CI

- add a job for windows builds;

### iOS

- make codegen name shorter;

### Android

- make codegen name shorter;

### C++

- make codegen name shorter;

## 🤔 How Has This Been Tested?

Tested on CI.

## 📸 Screenshots (if appropriate):

|Before|After|
|-------|-----|
|<img width="1250" height="824" alt="image"
src="https://github.com/user-attachments/assets/fa9a34de-3451-4689-9964-37b3f4576ca8"
/>|<img width="1201" height="203" alt="image"
src="https://github.com/user-attachments/assets/8788f6b8-3299-48f8-9d97-c91dd1a69c85"
/>|

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor You changed the code but it didn't affect functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use of massive filenames results in build failure on windows due to exceeding the max filename path

1 participant